package com.joolun.web.api;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.joolun.common.core.domain.AjaxResult;
import com.joolun.mall.entity.Cate;
import com.joolun.mall.service.ActiveService;
import com.joolun.mall.service.CateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/weixin/api/ma/cate")
@Api(value = "cate", tags = "分类")
public class CateApi {
    private final CateService baseService;
    @ApiOperation(value = "分页查询")
    @GetMapping("/getCate")
    public AjaxResult getWishCate(Integer id) {
        System.out.println(id);

        QueryWrapper<Cate> qw = new QueryWrapper<>();
        qw.eq("type", id);
        qw.orderByAsc("order_num");
        return AjaxResult.success(baseService.list(qw));
    }

}
